﻿using Xejen.Communication.Socket.Configuration;
using System;
using System.Collections.Generic;
using System.Text;

namespace Xejen.Communication.Socket.Abstract
{
    /// <summary>
    /// 用于创建一个Socket请求调用
    /// </summary>
    /// <typeparam name="TSocketInvoker"><inheritdoc cref="ISocketInvoker" path="/summary"/></typeparam>
    /// <creator>marc</creator>
    public interface ISocketInvokerCreator<TSocketInvoker>
    {
        /// <summary>
        /// 构建一个Socket请求驱动
        /// </summary>
        /// <param name="config"><inheritdoc cref="SocketConfig" path="/summary"/></param>
        /// <returns></returns>
        TSocketInvoker Create(ConnectionConfig config);
        /// <summary>
        /// 从已有的对象中获取一个，若不存在，则创建一个新的工业协议请求驱动
        /// </summary>
        /// <param name="config"><inheritdoc cref="SocketConfig" path="/summary"/></param>
        /// <returns></returns>
        TSocketInvoker CreateOrGet(ConnectionConfig config);
    }
}
